<div ng-controller="orderCostAppilcationController">
    <div class="bg-light lter b-b wrapper-sm">
        <h1 class="m-n font-thin h4">费用申领</h1>
    </div>

    <div class="wrapper-sm">
        <div class="panel panel-default">

            <div class="panel-body">

                <form name="step1" id="costForm" class="form-validation form-horizontal" autocomplete="off" novalidate>
                    <ng-form name="costF">
                        <button ng-show="false"></button>
                        <div class="form-group m-t-n" ng-show="true">
                            <div class="panel-heading font-bold m-b-sm">
                                合同信息
                            </div>
                            <label class="col-lg-1 pull-left control-label">合同号</label>
                            <div class="col-lg-2">
                                <input id="orderCostAppilcationCtrl_contractNumber" type="text" class="form-control input-sm" ng-model="contractNumber" disabled="disabled" placeholder="请填写合同号" name="contractNumber">
                            </div>

                        </div>

                        <div class="form-group" ng-show="true">
                            <div class="panel-heading font-bold m-b-sm">
                                费用申领
                            </div>
                            <label class="col-lg-1 pull-left control-label">费用类型<span class="text-danger">*</span></label>
                            <div class="col-lg-2">
                                <select id="orderCostAppilcationCtrl_feeType" class="form-control input-sm" ng-model="addFeeData.feeType" name="feeType" ng-disabled="" required ng-options="x.value as x.text for x in feeTypeDropDown">
                                    <option value="">请选择</option>
                                </select>
                            </div>

                            <label class="pull-left control-label w-xxss">付款方式<span class="text-danger">*</span></label>
                            <div class="col-lg-2">
                                <select id="orderCostAppilcationCtrl_paymentMethod" class="form-control input-sm" ng-model="addFeeData.paymentMethod" name="paymentMethod" ng-disabled="" required ng-options="x.value as x.text for x in paymentMethodList">
                                    <option value="">请选择</option>
                                </select>
                            </div>
                            <label class="pull-left control-label">申领金额<span class="text-danger">*</span></label>
                            <div class="col-lg-2">
                                <input type="text" id="orderCostAppilcationCtrl_applyFee" class="form-control input-sm" ng-model="addFeeData.applyFee" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" placeholder="请填写申领金额" required name="applyFee">
                            </div>
                            <label class="pull-left control-label">确认申领金额<span class="text-danger">*</span></label>
                            <div class="col-lg-2">
                                <input type="text" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" id="orderCostAppilcationCtrl_confirmApplyFee" class="form-control input-sm" ng-model="addFeeData.confirmApplyFee" placeholder="请填写申领金额" required name="confirmApplyFee" ui-validate-watch=" 'addFeeData.applyFee' " ui-validate=" '$value==addFeeData.applyFee' ">
                                <span class="text-danger m-l-sm" ng-show='costF.confirmApplyFee.$error.validator'>申领金额不匹配！</span>
                            </div>
                            <label class="pull-left control-label m-l-n-sm">元</label>
                            <div class="line  pull-in"></div>
                            <label class="col-lg-1 pull-left control-label">申请人<span class="text-danger">*</span></label>
                            <label class="col-lg-2 control-label text-left">{{proposer}}</label>
                            <label class="pull-left control-label w-xxss">结算承运商</label>
                            <div class="col-lg-2">
                                <input type="text" id="orderCostAppilcationCtrl_carrierName" class="form-control input-sm" ng-model="carrierName" placeholder="请填写结算承运商" disabled="disabled" name="carrier">
                            </div>

                        </div>
                    </ng-form>
                    <div class="form-group">
                        <div class="panel-heading font-bold m-b-sm">
                            支出事由
                        </div>
                        <label class="col-lg-1 pull-left control-label">支出事由</label>
                        <div class="col-lg-10">
                            <textarea id="orderCostAppilcationCtrl_payReson" class="form-control" ng-model="addFeeData.payReson" placeholder="请填写支出事由" name="payReson"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="panel-heading font-bold m-b-sm">
                            支出账户
                        </div>
                        <label class="col-lg-1 pull-left control-label">银行卡号<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input type="text" id="orderCostAppilcationCtrl_bankCode" class="form-control input-sm" ng-model="addFeeData.bankCode" placeholder="请填写开户银行" disabled="disabled" required name="bankCode">
                        </div>
                        <label class="w-xsss pull-left control-label">开户银行<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input type="text" id="orderCostAppilcationCtrl_openBank" class="form-control input-sm" ng-model="addFeeData.openBank" placeholder="请填写开户银行" disabled="disabled" required name="openBank">
                        </div>
                        <label class="w-xsss pull-left control-label">持卡人姓名<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input type="text" id="orderCostAppilcationCtrl_holder" class="form-control input-sm" ng-model="addFeeData.holder" placeholder="请填写持卡人姓名" disabled="disabled" required name="holder">
                        </div>
                    </div>
                    <div class="form-group">
                        
                        <div class="col-lg-7">
                            <button id="orderCostAppilcationCtrl_addFeeSave" ng-disabled="!costF.$valid" ng-click="addFeeSave()" ng-show="true" class="pull-left btn btn-sm btn-info btn-addon"><i class="fa fa-plus"></i>新增费用</button>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="wrapper-sm">
                            <div class="table-responsive table-cel-k">
                                <table class="table-bordered table-hover">
                                    <thead class="table-thea">
                                        <tr>
                                            <th width="9%">费用编号</th>
                                            <th width="9%">付款方式</th>
                                            <th width="9%">申领金额</th>
                                            <th width="9%">费用类型</th>
                                            <th width="9%">申领人</th>
                                            <th width="9%">结算承运商</th>
                                            <th width="9%">费用状态</th>
                                            <th width="9%">审核时间</th>
                                            <th width="9%">付款日期</th>
                                            <th width="9%">支出事由</th>
                                            <th width="5%">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody class="tab-tbod">
                                        <tr ng-repeat="item in feeList">
                                            <td title="{{item.feeCode}}">{{item.feeCode}}</td>
                                            <td title="{{item.paymentMethodStr}}">{{item.paymentMethodStr}}</td>
                                            <td title="{{item.applyAmountStr}}">{{item.applyAmountStr}}</td>
                                            <td title="{{item.feeTypeStr}}">{{item.feeTypeStr}}</td>
                                            <td title="{{item.applyPerson}}">{{item.applyPerson}}</td>
                                            <td title="{{item.settleCarrier}}">{{item.settleCarrier}}</td>
                                            <td title="{{item.feeStatusStr}}">{{item.feeStatusStr}}</td>
                                            <td title="{{item.auditedTime}}">{{item.auditedTime}}</td>
                                            <td title="{{item.payTime}}">{{item.payTime}}</td>
                                            <td title="{{item.payReason}}">{{item.payReason}}</td>
                                            <td>
                                                <div ng-if="item.feeStatusStr == '办理' || item.feeStatusStr == '退回办理' ">
                                                    <a id="orderCostAppilcationCtrl_editF{{item.id}}" data-toggle="modal" data-target="#detail" class="fa fa-edit m-l-xs  primary text-info" title="编辑" ng-click="editFeeSave(item)"></a>
                                                    <a class="primary fa fa-trash-o text-danger m-l-xs" id="orderCostAppilcationCtrl_deleteF{{item.id}}" title="删除" ng-click="deleteFeeSave(item.feeId)"></a>
                                                </div>
                                                <div ng-if="item.feeStatusStr != '办理' && item.feeStatusStr != '退回办理' ">
                                                    <a id="orderCostAppilcationCtrl_editF{{item.id}}"  data-toggle="modal" data-target="#detail" class="fa fa-eye m-l-xs  primary text-info" title="查看" ng-click="editFeeSave(item)"></a>
                                                </div>
                                            </td>

                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="m-l-sm">
                            <a id="orderCostAppilcationCtrl_skipBack" ng-click="skipBack()" class="pull-right-xs btn btn-sm btn-warning btn-addon"><i class="fa fa-mail-reply"></i>返回</a>
                        </div>

                    </div>

                    <!-- Modal -->
                    <div class="modal fade bs-example-modal-lg" id="detail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
                        <div class="modal-dialog modal-lg">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <a class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></a>
                                    <h4 class="modal-title" id="detailModalLabel">费用申领</h4>
                                </div>
                                <ng-form name="feeModal">
                                    <div class="modal-body">
                                        <div class="panel-heading font-bold m-b-sm">
                                            费用申领:
                                        </div>
                                        <div class="form-group">
                                            <label class="col-lg-2 control-label">费用类型<span class="text-danger">*</span></label>
                                            <div class="col-lg-3">
                                                <select class="form-control" id="orderCostAppilcationCtrl_feeTypeBox" ng-model="editFeeData.feeType" name="feeTypeBox" ng-disabled="feeDis" ng-options="x.value as x.text for x in feeTypeDropDown" required>
                                                    <option value="">全部</option>
                                                </select>
                                            </div>
                                            <label class="col-lg-2 control-label">付款方式<span class="text-danger">*</span></label>
                                            <div class="col-lg-3">
                                                <select class="form-control" id="orderCostAppilcationCtrl_paymentMethodBox" ng-model="editFeeData.paymentMethod" name="paymentMethodBox" ng-disabled="feeDis" ng-options="x.value as x.text for x in paymentMethodList" required>
                                                    <option value="">全部</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-lg-2 control-label">申领金额<span class="text-danger">*</span></label>
                                            <div class="col-lg-3">
                                                <input type="text" id="orderCostAppilcationCtrl_applyFeeBox" ng-disabled="feeDis" class="form-control" ng-model="editFeeData.applyFee" name="applyFeeBox" required>
                                            </div>
                                            <div ng-show="applyMoneyDis">
                                                <label class="col-lg-2 control-label">确认申领金额<span class="text-danger">*</span></label>
                                                <div class="col-lg-3">
                                                    <input type="text" id="orderCostAppilcationCtrl_confirmApplyFeeBox" ng-disabled="feeDis" class="form-control input-sm" ng-model="confirmApplyFeeBox" placeholder="请填写申领金额" required name="confirmApplyFeeBox"  ui-validate=" '$value==editFeeData.applyFee' " ui-validate-watch=" 'editFeeData.applyFee' ">
                                                    <span class="text-danger m-l-sm" ng-show='feeModal.confirmApplyFeeBox.$error.validator'>申领金额不匹配！</span>
                                                </div>
                                            </div>
                                        </div>


                                        <div class="form-group">
                                            <label class="col-lg-2 control-label">申领人<span class="text-danger">*</span></label>
                                            <label class="col-lg-2 control-label text-left">{{editFeeData.applicant}}</label>

                                            <label class="col-lg-3 control-label">结算承运商</label>
                                            <label class="col-lg-2 control-label text-left">{{editFeeData.carrier}}</label>
                                        </div>

                                        <div class="panel-heading font-bold m-b-sm">
                                            支出事由:
                                        </div>
                                        <div class="form-group">
                                            <label class="col-lg-2 control-label">支出事由</label>
                                            <div class="col-lg-6">
                                                <textarea class="form-control" ng-disabled="feeDis" ng-model="editFeeData.payReson" placeholder="请填写支出事由" name="payResonBox"></textarea>
                                            </div>
                                        </div>
                                        <div class="panel-heading font-bold m-b-sm">
                                            支出账户:
                                        </div>
                                        <div class="form-group">
                                            <label class="col-lg-2 control-label">银行卡号<span class="text-danger">*</span></label>
                                            <div class="col-lg-3">
                                                <div angucomplete-alt
                                                     id="bankCode"
                                                     disable-input="feeBankDis"
                                                     maxlength="21"
                                                     placeholder=""
                                                     pause="100"
                                                     selected-object="onBankSelected"
                                                     remote-api-handler="onBankAutoComplate"
                                                     search-fields="cardNumber"
                                                     title-field="cardNumber"
                                                     minlength="3"
                                                     input-class="form-control form-control-small input-sm"
                                                     initial-value="editFeeData.bankCode"
                                                     input-changed="getBankNameInfo"
                                                     match-class="highlight"
                                                >
                                                </div>
                                            </div>
                                            <label class="col-lg-2 control-label">开户银行<span class="text-danger">*</span></label>
                                            <div class="col-lg-3">
                                                <input type="text" id="open_bank" class="form-control input-sm" ng-model="editFeeData.openBank" placeholder="请填写开户银行" ng-disabled="openBankDis" required name="openBankBox">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-lg-2 control-label">持卡人姓名<span class="text-danger">*</span></label>
                                            <div class="col-lg-3">
                                                <input type="text" id="holder" class="form-control input-sm" ng-model="editFeeData.holder" placeholder="请填写持卡人姓名" ng-disabled="feeBankDis" required name="holderBox">
                                            </div>
                                        </div>
                                        <input id="hidden_input" name="hidden-input" ng-show="false" type="text" />
                                    </div>
                                    <div class="modal-footer">
                                        <button id="orderCostAppilcationCtrl_cancel"  class="btn btn-default" data-dismiss="modal">取消</button>
                                        <button id="orderCostAppilcationCtrl_saveFee" class="btn btn-primary" ng-disabled="!feeModal.$valid" ng-if="!feeDis" ng-click="saveFee()">保存</button>
                                    </div>
                                </ng-form>
                            </div>
                        </div>
                    </div>

                    <!--passWord-->
                    <div class="modal fade" id="passWord" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
                        <ng-form name="passwordMoal" class="form-validation form-horizontal">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <a id="orderCostAppilcationCtrl_close" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></a>
                                        <h4 class="modal-title" id="passWordModalLabel">输入密码</h4>
                                    </div>
                                  
                                    <div class="modal-body">
                                        <div class="form-group">
                                            <label class="col-lg-3 control-label">申请密码<span class="text-danger">*</span></label>
                                            <div class="col-lg-4">
                                                <input type="password"id="orderCostAppilcationCtrl_applyPassword" class="form-control input-sm" ng-model="applyPassword" ng-change="changePass()"  autocomplete="off" ng-minlength="6" ng-maxlength="6"  placeholder="请填写申领密码" name="applyPassword" ng-pattern="/[1-9]\d*$/" required>
                                                <span class="text-danger m-l-sm" ng-if="applyPasswordDis">申领密码错误！</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="modal-footer">
                                        <button id='orderCostAppilcationCtrl_cancelBox' class="btn btn-default" data-dismiss="modal">取消</button>
                                        <button id="orderCostAppilcationCtrl_verifyPW" class="btn btn-primary" ng-disabled="(verifyPWDis || !passwordMoal.$valid) " ng-click="verifyPW()">确定</button>
                                    </div>
                                </div>
                            </div>
                        </ng-form>
                    </div>
                </form>

            </div>
        </div>

    </div>
</div>